package com.zero.taskthread;


import com.zero.taskthread.bl.ActivationManagerServer;
import com.zero.taskthread.bl.ShutDownInterceptor;
import org.apache.commons.collections.MapUtils;

import java.util.HashMap;
import java.util.Map;

public class OttStartup {

    public void start(String... args) {
        Map map=new HashMap();
        map.put("TOTAL_NUM",1);
        Map config;
        for (int i=0;i<1;i++) {
            config = new HashMap();
            config.putAll(map);
            config.put("CURRENT",i);
            ActivationManagerServer activationManagerServer = new ActivationManagerServer(config);
            activationManagerServer.start();
            Runtime.getRuntime().addShutdownHook(new ShutDownInterceptor(activationManagerServer));
        }

        synchronized (Thread.currentThread()) {
            try {
                Thread.currentThread().wait(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
